package cn.cxy.myapplication

import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        tabView.initTabs("标签1", "标签2", 1, object : TabView.OnSwitchListener {
            override fun onSwitched(selectedIndex: Int) {
                Toast.makeText(this@MainActivity, "被选择标签$selectedIndex", Toast.LENGTH_LONG).show()
            }
        })
    }
}